<?php
class BrandSmallCloud extends CWidget
{
	public $postParams=array();
	public $config=array();
	
	public function run()
  	{?>


<div>
	<h2 class="mod_title helv_black" style=" font-size:25px; color:#333333;">Brand<span class="helv_neue_thin"> Cloud</span></h2>
	<div class="mt5">
							<?php 
							$Brands = Vendor::getList("ALL-RAND");
							$brandnameCSS = array(0=>'font-weight:bold;font-size:18px;color:#C14B23',1=>'font-weight:normal;font-size:17px;color:#E99F86');
							$brandtitleCSS = array(0=>'color:#E99F86;font-weight:bold;',1=>'color:#C14B23');
							$brandofferCSS = array(0=>'color:#C14B23',1=>'color:#E99F86;font-weight:bold;');
							if (count($Brands)<10)
							{
								
								for ($i=0;$i<2;$i++){
								foreach ($Brands as $brand)
								{
									$brandcssRand = array_rand($brandnameCSS);
									echo "<a style='$brandnameCSS[$brandcssRand]' href='".ApplicationConfig::getURL("", "site", "brands",array("id"=>$brand->vendorID))."'> <b>".$brand->vendor_name."</b></a> "." <span style='$brandofferCSS[$brandcssRand]'>".ApplicationConfig::app()->params['vendor_params']['type'][$brand->vendor_type]."</span> ";
									$job = Job::model()->getModel('VENDOR-RAND-ID',array('vendorID'=>$brand->vendorID));
									if (!empty($job))
										echo " <span style='$brandtitleCSS[$brandcssRand]'>".$job->job_title."</span> ";
									$offer = Offer::model()->getModel('VENDOR-RAND-ID',array('vendorID'=>$brand->vendorID));
									if (!empty($offer))
										echo " <span style='$brandofferCSS[$brandcssRand]'>".$offer->offer_title."</span> ";
								}
								}
								
							}
							else 
							{
								foreach ($Brands as $brand)
								{
									echo "<a href='".ApplicationConfig::getURL("", "site", "brands",array("id"=>$brand->vendorID))."'> <b>".$brand->vendor_name."</b></a> ".ApplicationConfig::app()->params['vendor_params']['type'][$brand->vendor_type]." ";
									$job = Job::model()->getModel('VENDOR-RAND-ID',array('vendorID'=>$brand->vendorID));
									if (!empty($job))
										echo " ".$job->job_title." ";
									$offer = Offer::model()->getModel('VENDOR-RAND-ID',array('vendorID'=>$brand->vendorID));
									if (!empty($offer))
										echo $offer->offer_title." ";
								}
							}
						
						?>	
	</div>
</div>

  		
  	<?php }
}
?>  
 